<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>wdpa</Title>
            <Shortcut>wdpa</Shortcut>
            <Description>wpf附加属性</Description>
            <Author>singba</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>type</ID>
                    <ToolTip>类型</ToolTip>
                    <Default>int</Default>
                </Literal>
                <Literal>
                    <ID>property</ID>
                    <ToolTip>属性名称</ToolTip>
                    <Default>MyProperty</Default>
                </Literal>
                <Literal default="true" Editable="false">
                    <ID>ownerClass</ID>
                    <ToolTip>Owner Class</ToolTip>
                    <Function>ClassName()</Function> 
                </Literal>
                <Literal>
                    <ID>defaultValue</ID>
                    <ToolTip>默认值</ToolTip>
                    <Default>null</Default>
                </Literal>
            </Declarations>
            <Code Language="csharp">
                <![CDATA[#region $property$ DependencyProperty
		public static readonly DependencyProperty $property$Property =
            DependencyProperty.RegisterAttached("$property$", typeof($type$), typeof($ownerClass$),
            new PropertyMetadata($defaultValue$,On$property$ValueChanged));

        public static $type$ Get$property$(UIElement obj)
        {
            return ($type$)obj.GetValue($property$Property);
        }

        public static void Set$property$(UIElement obj, $type$ value)
        {
            obj.SetValue($property$Property, value);
        }

        private static void On$property$ValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if(d !=null && d is UIElement element)
            {
				
			}
        }		
			#endregion
				$end$
			]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

